/*
 * 
 */
package actions;

import org.salespointframework.core.Action;
import org.salespointframework.core.SaleProcess;
import org.salespointframework.core.SalesPoint;
import org.salespointframework.core.Transition;
import org.salespointframework.core.UIGate;

/**
 * The Class TransitWithAction.
 */
public class TransitWithAction implements Action {
	
	/** The transition. */
	private Transition transition;

	/**
	 * Instantiates a new transit with action.
	 *
	 * @param transition the transition
	 */
	public TransitWithAction(Transition transition) {
		this.transition = transition;
	}

	/* (non-Javadoc)
	 * @see org.salespointframework.core.Action#doAction(org.salespointframework.core.SaleProcess, org.salespointframework.core.SalesPoint)
	 */
	public void doAction(SaleProcess saleProcess, SalesPoint salePoint)
			throws Throwable {
		UIGate currentGate = (UIGate) saleProcess.getCurrentGate();
		currentGate.setNextTransition(transition);
	}

}
